package com.plugin.manage.controller;

import com.plugin.manage.pojo.dto.ElderAssessmentInfoDTO;
import com.plugin.manage.common.PageResult;
import com.plugin.manage.common.RespObj;
import com.plugin.manage.service.IElderAssessmentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 老人评估信息控制器
 *
 * @author mark
 * @date 2025-08-01
 */
@Slf4j
@RestController
@RequestMapping("/assessment")
@Tag(name = "AssessmentController", description = "老人评估信息接口")
public class AssessmentController {

    @Autowired
    private IElderAssessmentService elderAssessmentService;

    /**
     * 获取老人评估信息（分页）
     *
     * @param current 当前页
     * @param size 每页大小
     * @return 分页结果
     */
    @PostMapping("/list")
    @Operation(summary = "获取老人评估信息", description = "分页获取老人评估信息，包含老人基本信息、评估信息和入住状态")
    public RespObj<?> getElderAssessmentInfo(
            @Parameter(description = "当前页", example = "1") @RequestParam(defaultValue = "1") Long current,
            @Parameter(description = "每页大小", example = "10") @RequestParam(defaultValue = "10") Long size) {
        PageResult<ElderAssessmentInfoDTO> result = elderAssessmentService.getElderAssessmentInfo(current, size);
        return new RespObj<>().success(result);
    }
}
